package woc.dao.impl;

import java.util.Iterator;
import java.util.List;

import woc.dao.WorkExpPropertyValueDAO;
import woc.dao.base.RootDAOImpl;
import woc.data.WorkExp;
import woc.data.WorkExpPropertyValue;

public class WorkExpPropertyValueDAOImpl extends RootDAOImpl<WorkExpPropertyValue> implements WorkExpPropertyValueDAO{

	public WorkExpPropertyValueDAOImpl() {
		super(WorkExpPropertyValue.class);
	}

	public List<WorkExpPropertyValue> getWorkExpPropertyValueListByWorkExp(List<WorkExp> tbWorkExpList) {

		StringBuffer workIdListStr=new StringBuffer(" (");
		for (Iterator<WorkExp> iterator = tbWorkExpList.iterator(); iterator.hasNext();) {
			WorkExp tbWorkExp = iterator.next();
			workIdListStr.append(tbWorkExp.getId()+",");
		}
		workIdListStr.deleteCharAt(workIdListStr.length()-1);
		workIdListStr.append(") "); 
		return find("from WorkExpPropertyValue WHERE deleted=false AND workExpId in "+workIdListStr);
	}

}
